<template>
	<view class="p50">
		<u-form labelWidth="auto" :borderBottom="false">
			<u-form-item>
				<view class="p10 pl30 pr30 w-max bg-f8f radius20">
					<u-input v-model="form.mobile" maxlength="11" placeholder="请输入手机号码"></u-input>
				</view>
			</u-form-item>
			<u-form-item>
				<view class="p10 pl30 pr30 w-max bg-f8f radius20 flex row-between" >
					<u-input v-model="form.code" class="flex1" placeholder="请输入短信验证码"></u-input>
					<tips :mobile="form.mobile" type="m_bind" />
				</view>
			</u-form-item>
		</u-form>
		<u-button type="warning" @click="submit">确定</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					mobile: '',
					oldcode:'',
					code:''
				},
			};
		},
		onLoad(e) {
			this.form.oldcode=e.code
		},
		methods: {
			submit() {
				this.$request('/member/personal/bindMobile', this.form).then(res => {
					this.$msg(res.msg)
					setTimeout(()=>{
						uni.switchTab({
							url:'/pages/my/my'
						})
					},1000)
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}
</style>
